"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = {
    data: function () {
        return {
            visibleModal: false,
            titleModal: void 0,
            componentContent: void 0,
            widthModal: 1000,
            footer: void 0 //尾部组件
        };
    },
    methods: {
        handleCloseModal: function () {
            this.visibleModal = false;
            this.componentContent = null;
            this.footer = null;
        },
        initFramFlow: function () {
            var _this = this;
            if (!window.FlowOpen) {
                window.FlowOpen = {};
            }
            window.FlowOpen.callback = function () {
                _this.handleOpenModal();
                _this.handleSearch && _this.handleSearch();
            }; //全局注册关闭事件
        },
        handleOkModal: function () {
            this.visibleModal = true;
        },
        handleOpenModal: function (visible, title, width, componentContent, props, footer) {
            this.visibleModal = visible;
            this.titleModal = title;
            this.widthModal = width;
            var defaultProps = {
                onCancel: this.handleCloseModal,
                onOk: this.handleOkModal
            };
            var newProps = Object.assign(defaultProps, props);
            this.componentContent = this.$createElement(componentContent, {
                props: newProps
            });
            if (footer) {
                this.footer = this.$createElement(footer, {
                    props: newProps
                });
            }
        }
    }
};
